typedef struct server_global_atom
{
	Atom _XROOTPMAP_ID;
	Atom _NET_CURRENT_DESKTOP;
	Atom _NET_ACTIVE_WINDOW;
	Atom _NET_WM_WINDOW_TYPE;
	Atom _NET_WM_SKIP_PAGER;
	Atom _NET_WM_STATE_SKIP_TASKBAR;
	Atom _NET_WM_WINDOW_TYPE_DOCK;
	Atom _NET_WM_WINDOW_TYPE_DESKTOP;
	Atom _NET_WM_WINDOW_TYPE_TOOLBAR;
	Atom _NET_WM_WINDOW_TYPE_MENU;
	Atom _NET_WM_WINDOW_TYPE_SPLASH;
	Atom _NET_WM_DESKTOP;
	Atom WM_STATE;
	Atom _NET_WM_STATE;
	Atom _NET_WM_STATE_SHADED;
	Atom _NET_WM_STATE_BELOW;
	Atom _NET_CLIENT_LIST;
	Atom _NET_WM_VISIBLE_NAME;
	Atom _NET_WM_STRUT;
	Atom _NET_WM_ICON;
	Atom UTF8_STRING;
	Atom _NET_SUPPORTING_WM_CHECK;
	Atom _NET_WM_NAME;
}
server_global_atom;

typedef struct server_global
{
	Display *dsp;
	Window root_win;
	int desktop;
	int screen;
	int depth;
	int screen_width;
	int screen_height;
	int x;
	int y;
	int got_root_pmap;
	int got_root_win;
	Visual *visual;
	Pixmap pmap;
	Pixmap root_pmap;
	GC gc;
	struct server_global_atom atom;
}
server_global;
server_global server;



void *server_get_property (Window win, Atom at, Atom type, int *num_results);
int server_get_current_desktop ();
Atom server_get_atom (char *atom_name);
void server_refresh_root_pixmap ();
void server_refresh_main_pixmap ();
void server_catch_error (Display *d, XErrorEvent *ev);
void server_init_atoms ();
Pixmap server_create_pixmap (int width, int height);
